using LogService.Interface;

namespace LogService;

public class LoggerManager
{
    private readonly List<ILoggerObserver> _loggers = new();

    public void AddLogger(ILoggerObserver logger)
    {
        _loggers.Add(logger);
    }

    public void RemoveLogger(ILoggerObserver logger)
    {
        _loggers.Remove(logger);
    }

    public void Log(string message)
    {
        foreach (var logger in _loggers)
        {
            logger.Update(message);
        }
    }
}